FROM alpine:3.14


RUN set -eux && \
    mkdir  /init && \
    sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories && \
    apk update && \
    apk  add tini && \
    apk  add bash && \
    apk add nginx && \
    apk add openssh-server && \
    echo "root:123" | chpasswd && \
    su - && \
    ssh-keygen -A > hostkey.log  && \
    sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config  && \
    rm -rf /var/cache/apk/*

EXPOSE 80/TCP 443/TCP 9001/TCP 22/TCP

WORKDIR /init


COPY ["init/*", "/init/"]
COPY ["init/init.d/*", "/init/init.d/"]

ENTRYPOINT [ "/init/supervisord","-c","/init/supervisor.conf"]
